package klass.parse.domain.constant.factory;

import klass.parse.domain.constant.Constant;
import klass.parse.domain.constant.ConstantUtf8Info;

import java.io.InputStream;
import static klass.parse.util.InputStreamUtils.*;

public class ConstantUtf8Factory extends BaseConstantFactory {
    @Override
    public Constant create(InputStream inputStream) {
        short length = nextShort(inputStream);
        String value = nextString(inputStream, length);
        return new ConstantUtf8Info(value);
    }
}
